<?php
/**
*
*
*
*/

class CI_Common extends CI_Model{
	private $_database;
	public function __construct() {
		$this->_database = $this->db->conn_id;
	}
	public function getCountry($showComboBox = 1) {
		$stmt = $this->_database->prepare('CALL com_country_getall()');
		$stmt->execute();
		$result = $stmt->fetchAll();
		if($showComboBox) {
			$ret = array();
			foreach ($result as $row) {
				$ret[$row['code']]=$row['name'];
			}			
			return $ret;
		}
		return isset($result)? $result:array();
	}
	public function getSeason() {
		$stmt = $this->_database->prepare('CALL com_season_getall()');
		$stmt->execute();
		$result = $stmt->fetchAll();
		$req	= array();
		if(!empty($result)){
			foreach($result as $row){
				$req = array($row['seasonid'] => $row['season_name']);
			}
			return $req;
		}
		return isset($req)? $req:array();
	}
}